package com.zx.znav.service;

import com.zx.znav.bean.Navigation;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
* @author lenovo
* @description 针对表【t_navigation】的数据库操作Service
* @createDate 2023-07-19 16:44:10
*/
public interface NavigationService extends IService<Navigation> {
    //查询导航菜单
    List<Navigation> listFirstNavigation();
    List<Navigation> listSecondNavigation();

    /**
     * 搜索一级导航菜单
     * 根据导航菜单名模糊搜索
     */
    List<Navigation> searchFirstNavigation(Navigation navigation);

    /**
     * 搜索二级导航菜单
     * 1.根据导航菜单名模糊搜索
     * 2.根据导航菜单上级菜单id查询
     */
    List<Navigation> searchSecondNavigation(Navigation navigation);


    //根据一级导航菜单，获取二级导航菜单列表
    List<Navigation> listSecondNavByFirstNavId(Integer id);


    /**
     * 根据二级导航菜单id,操作其一级导航菜单linkCnt
     * @param increase true: +1 , false: -1
     */
    void operateLinkCntById(Integer id, boolean increase);


    //查询一级导航下二级导航数目
    Integer countSecondNavByFirstNavId(Integer firstNavId);
}
